home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)t8.d64
/
gradebook.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
7KB
|
266 lines
1 CLOSE15:OPEN15,8,15:GOTO5
2 INPUT#15,A,A$:IFA<=1THENRETURN
3 PRINTA$:IFA=62ORA=63THENRETURN
4 STOP
5 POKE53280,12:POKE53281,12:PRINTCHR$(5)CHR$(8)CHR$(14):Z$=CHR$(0):DD$="XXX"
10 NG=50:REM NG=NUMBER OF GRADES
20 NS=50:REM NS=NUMBER OF STUDENTS
30 DIM SN$(NS),SB$(NG),WT$(NG),WT(NG), A(NS,NG)
40 DEFFNGR(I)=INT((A(I,J)/2.5)+.5)
45 DEFFNRD(X)=INT(100*X+.5)/100
50 PRINT"[147] [199][210][193][196][197][194][207][207][203] 7.0
60 [153]" (null)OM (null)ICHARDSON
70 PRINT" [196]ANA [195]OLLEGE
80 [153]" (null)CTOBER 1983
90 FORI=1TO1000:NEXT
100 PRINT"[147] [199]RADEBOOK 7.0 [207]CT 1983"
110 PRINT" A. NEW FILE
120 [153]" B. EXISTING FILE
130 PRINT" C. TERMINATE
140 [153]" PRESS A LETTER
150 GS$="ABC":GOSUB3800
160 IFV=3THENEND
170 GOSUB4400
300 PRINT"[147][199]RADEBOOK 7.0 [207]CT 1983"
310 PRINT"CURRENT FILE IS "F$
320 PRINT" A. ENTER GRADES
330 [153]" B. INSPECT GRADES
340 PRINT" C. LIST GRADES
350 [153]" D. CALCULATE GRADES
360 PRINT" E. CLASS/ENTRY LIST
370 [153]" F. ANOTHER FILE
380 PRINT" G. TERMINATE
390 GS$[178]"ABCDEFG":[141]3800:VV[178]V
395 [145]V[137]600,700,700,1700,400,500,500
400 [153]"(null)IST BY SWAITTUDENT OR EWAITNTRY":GS$[178]"SE":J[178]0:[141]3800:[145]V[137]410,450
410 [141]440:[141]3900:KK[178]0: [129]K[178]1[164]NS
411 I[178]K:[141]5100:[139]FG[178]1[167]430
412 [153]SN$;:KK[178]KK[170]1: [139]KK[178]1[167][153][163]20);
413 [139]KK[178]2[167]KK[178]0:[153]
420 J[178]J[170]1:[139]J[178]40[167][141]3900:[141]3700:J[178]0:[141]440:[141]3900
430 [130]:[137]480
440 [153]"LOADLENLASS LIST OF "F$:[142]
450 [141]490:[141]3900:[129]K[178]1[164]NG[169]2:[153]SB$(K)[163]20)SB$(K[170]1)
460 J[178]J[170]1:[139]J[178]20[167][141]3900:[141]3700:J[178]0:[141]490:[141]3900
470 [130]
480 [141]3900:[141]3700:[137]300
490 [153]"LOAD(null)UBJECT LIST OF "F$:[142]
500 [139]SD[178]1[167][141]4900
510 [139]V[178]6[167]100
520 [128]
600 [143] GRADE ENTRY
610 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null) ENTRY FOR "F$
620 [153]"LAST ENTRY WAS #"NG[171]1"CMD: "SB$(NG[171]1)
630 [153]"TITLE FOR THIS ENTRY #"NG"CMD:":SD[178]1
640 [133]" *CMDCMDCMD";SB$(NG)
650 [153]"VALNTER GRADE FOR EACH STUDENT
660 FORI=1TONS:GOSUB5100:IFFG=1 THENA(I,NG)=0:GOTO695
665 PRINT""SN$(I)" "
670 INPUT" *[157][157][157]";G$
680 A(I,NG)=INT(2.5*VAL(G$)): IFA(I,NG)>255THENA(I,NG)=255
690 PRINT"[145] "
695 NEXT:NG=NG+1:GOTO300
700 REM INSPECT/CORRECT/LIST GRADES
710 PRINT"[147][199][210][193][196][197][194][207][207][203] FOR "F$
720 IFV=2THENPRINT"[201]NSPECT/CORRECT GRADES BY
730 [139]V[178]3[167][153]"LIST GRADES FOR
740 PRINT" S[146]TUDENT
750 [153]" EWAITNTRY
760 GS$="SE":GOSUB3800
770 ONVGOSUB3500,3600
780 IFSS$="*"THEN300
790 IFVV=3THENPRINT"[147][199]RADES FOR "; :ONVGOTO1000,1100
800 PRINT"[147][199]RADE INSPECTION/CORRECTION FOR
810 [153]" ";:[145]V[137]1200,1500
1000 [143] LIST GRADES FOR STUDENT
1010 [153]SN$(I)"":CT[178]0
1020 [129]J[178]1[164]NG
1030 [153]SB$(J)[163]20)[165]GR(I)
1040 CT[178]CT[170]1:[139]CT[178]20[167]CT[178]0:[141]3900:[141]3700:[141]3900:[153]""SN$(I)""
1050 [130]:[141]3900:[141]3700:[137]300
1100 [143] LIST GRADES FOR SUBJECT
1110 [153]SB$(I)"":CT[178]0:J[178]I
1120 [129]I[178]1[164]NS
1125 [141]5100:[139]FG[178]1[167]1150
1130 [153]SN$(I)[163]20)[165]GR(I)
1140 CT[178]CT[170]1:[139]CT[178]20[167]CT[178]0:[141]3900:[141]3700:[153]"LOAD"SB$(J)""
1150 [130]:[141]3900:[141]3700:[137]300
1200 [143] INSPECT GRADES BY STUDENT
1210 [153]SN$(I)
1220 [153]"PRESS RETURNWAIT IF GRADE IS CORRECT
1240 PRINT" PRESS X[146] TO CHANGE
1250 [129]J[178]1[164]NG:[153]" "
1255 [153]"ON"SB$(J)[163]20)[165]GR(I)
1260 GS$[178]"X"[170][199](13):[141]3800
1270 [139]V[178]2[167]1310
1280 [133]"CORRECT GRADE CMD *CMDCMDCMD";A$
1290 [153]"ON ":A(I,J)[178][181](2.5[172][197](A$))
1300 SD[178]1:[139]A(I,J)[177]255[167]A(I,J)[178]255
1310 [130]:[137]300
1500 [143] INSPECT GRADES BY ENTRY
1510 J[178]I:[153]SB$(J)
1520 [153]"PRESS RETURNWAIT IF GRADE IS CORRECT
1540 PRINT" PRESS X[146] TO CHANGE
1550 [129]I[178]1[164]NS:[141]5100:[139]FG[178]1[167]1620
1560 [153]" "
1565 [153]"ON"SN$(I)[163]20)[165]GR(I)
1570 GS$[178]"X"[170][199](13):[141]3800
1580 [139]V[178]2[167]1620
1590 [133]"CORRECT GRADE CMD *CMDCMDCMD";A$
1600 [153]"ON ":A(I,J)[178][181](2.5[172][197](A$))
1610 SD[178]1:[139]A(I,J)[177]255[167]A(I,J)[178]255
1620 [130]:[137]300
1700 [143] CALCULATE GRADES FROM DATA THIS PART--SELECT WEIGHTS
1710 [141]1800:K[178]0:[143] PRINT HEAD
1720 [129]J[178]1[164]NG:LL[178]J:L[178]J:[141]1850
1730 K[178]K[170]1:[139]K[178]8[167][141]1900:K[178]0
1740 [130]:[141]1900
1750 [137]2000
1800 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null) FOR "F$
1810 [153]" LENURRENT WEIGHTING FACTORS" :[141]3900:[153]:[142]
1850 A$[178][201](" "[170][196](L),3)
1860 [153]A$[163]10)SB$(L)[163]30)WT$(L)
1870 [142]
1900 [143] PAUSE IN WEIGHT CHECK
1910 [141]3900:[153]" ANY CHANGES YWAIT/N" :GS$[178]"YN":[141]3800:[139]V[178]2[167]1970
1920 [133]"WHICH ONE CMD *CMDCMDCMD";A$
1930 A[178][197](A$):[139]A[178]0[167][153]"ONONON": [137]1920
1940 [153]"CURRENT WEIGHT IS "WT$(A)
1950 [133]"NEW WEIGHT CMD *CMDCMDCMD";WT$(A)
1960 [153]"MORE CHANGES YWAIT/N": SD[178]1:GS$[178]"YN":[141]3800
1970 [141]1800:[139]V[178]2[167][142]
1980 [129]L[178]LL[170]1[171]K[164]LL:[141]1850:[130]
1990 [137]1900
2000 [153]"(null)ORMALIZING WEIGHTS, PLEASE STAND BY":SU[178]0
2010 [129]J[178]1[164]NG:WT(J)[178][197](WT$(J)) :SU[178]SU[170]WT(J):[130]
2020 [129]J[178]1[164]NG:WT(J)[178]WT(J)[173]SU:[130]
2100 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null) FOR "F$
2110 [153]" CHR$RADE CALCULATION--WEIGHTED RESULT FOR
2120 PRINT" S[146]TUDENTS
2130 [153]" EWAITNTRIES
2140 GS$="SE":GOSUB3800:IFV=2THEN2500
2200 REM GRADE FOR STUDENT
2205 PRINT:GOSUB3900:PRINT
2210 PRINT" C[146]LASS
2220 [153]" IWAITNDIVIDUAL
2230 GS$="CI":GOSUB3800
2240 PRINT"[147][215]EIGHTED GRADE FOR
2250 [139]V[178]1[167]2400
2260 [141]3500:[139]SS$[178]"*"[167]300
2270 [141]2300:[153]""SN$(I)
2280 [153]" IS"SU""
2290 [141]3700:[137]300
2300 SU[178]0:[129]J[178]1[164]NG
2310 SU[178]SU[170][165]GR(I)[172]WT(J)
2320 [130]:SU[178][165]RD(SU):[142]
2400 [141]3350:[143] SET STATS
2410 [153]"":K[178]0:[129]I[178]1[164]NS:[141]5100 :[139]FG[178]1[167]2450
2420 [141]2300:[153]SN$(I)[163]20)SU
2430 [141]3400
2440 K[178]K[170]1:[139]K[178]15[167][141]3900:[141]3700 :[141]3900:[153]"LOAD":K[178]0
2450 [130]
2460 [141]3450
2470 [153]" AVG WEIGHTED GRADE ="AV
2480 [153]" STANDARD DEVIATION ="DV :[153]""
2490 [141]3700:[137]300
2500 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null) FOR "F$
2510 [141]3600:[139]SS$[178]"*"[167]300
2520 [141]3350
2530 J[178]I:[129]I[178]1[164]NS
2540 [141]5100:[139]FG[178]1[167]2570
2550 SU[178][165]GR(I)
2560 [141]3400
2570 [130]I
2580 [153]"FOR ENTRY "SB$(J)
2590 [141]3450
2600 [153]" AVERAGE GRADE ="AV
2610 [153]" STANDARD DEV ="DV""
2620 [141]3700:[137]300
3299 [137]300
3350 [143] INIT FOR STATS
3360 SX[178]0:X2[178]0:N[178]0
3370 [142]
3400 [143] STAT ENTRY
3410 SX[178]SX[170]SU:X2[178]X2[170]SU[172]SU:N[178]N[170]1
3420 [142]
3450 [143] STAT CALCN
3460 AV[178]SX[173]N:DV[178][186]((X2[171]N[172]AV[172]AV)[173](N[171]1))
3470 AV[178][165]RD(AV):DV[178][165]RD(DV)
3480 [142]
3500 [143] NAME SEARCH
3510 [133]"VALNTER NAME *CMDCMDCMD";SS$
3520 [139]SS$[178]"*"[167][142]
3530 LL[178][195](SS$)
3540 [129]I[178]1[164]NS:K[178][195](SN$(I))[171]LL[170]1:[129]J[178]1[164]K
3550 [139]SS$[178][202](SN$(I),J,LL)[167][142]
3560 [130]J:[130]I:[153]""SS$" NOT IN "F$:[137]3510
3600 [143] SUBJECT SEARCH
3610 [133]"VALNTER SUBJECT *CMDCMDCMD";SS$
3620 [139]SS$[178]"*"[167][142]
3630 LL[178][195](SS$)
3640 [129]I[178]1[164]NS:K[178][195](SB$(I))[171]LL[170]1:[129]J[178]1[164]K
3650 [139]SS$[178][202](SB$(I),J,LL)[167][142]
3660 [130]J:[130]I:[153]""SS$" NOT IN "F$:[137]3610
3700 [153]"PRESS RETURNWAIT TO CONTINUE": GS$[178][199](13)
3800 [161]G$:[129]V[178]1[164][195](GS$):[139][202](GS$,V,1)[178]G$[167][142]
3810 [130]:[137]3800
3900 [153]"---------------------------------------":[142]
4400 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null)--GET A FILE":VV[178]V
4410 [139]V[178]1[167][153]"(null)EW FILE"
4420 [139]V[178]2[167][153]"VALXISTING FILE"
4430 [133]"ENTER NAME OF FILE*CMDCMDCMD";F$
4440 [139]F$[178]"*"[167][128]
4450 F$[178][200](F$,15)
4460 [153]"VERIFY NAME YWAIT/NWAIT: "F$
4470 GS$[178]"YN":[141]3800:[139]V[178]2[167]4430
4480 [159]8,8,8,"0:N"[170]F$[170]",S,R":[141]2
4490 [139]A[178]62[167][167][160]8:[137]4430
4500 [161]#8,A$:NS[178][198](A$[170]Z$)
4505 [153]"READING NUMBER OF STUDENTS"
4510 [139]VV[178]2[167]4700
4520 [159]9,8,9,"0:G"[170]F$[170]",S,W":[141]2
4530 [139]A[178]63[167][160]9:[137]4700
4535 [153]"CREATING GRADES FILE"
4540 [152]9,[199](1);
4550 [152]9,DD$
4560 [152]9,DD$
4570 [129]I[178]1[164]NS
4580 [152]9,[199](0);
4590 [130]I
4600 [160]9
4700 [159]9,8,9,"0:G"[170]F$[170]",S,R":[141]2
4710 [139]A[178]62[167][160]9:[137]4520
4715 [153]"READING GRADES FILE"
4720 [161]#9,A$:NG[178][198](A$[170]Z$)
4730 [129]J[178]1[164]NG
4735 [132]9,SB$(J)
4740 [132]9,WT$(J)
4760 [129]I[178]1[164]NS
4770 [161]#9,A$:A(I,J)[178][198](A$[170]Z$)
4780 [130]I:[130]J
4790 [160]9
4800 [153]"READING NAMES FILE"
4805 [129]I[178]1[164]NS:[132]8,SN$(I):[130]
4810 [160]8:[142]
4900 [153]"LOADCHR$(null)ATNSTR$VALPEEK(null)(null)(null): (null)AVING DATA FOR ":[153]""F$
4910 [152]15,"S0:GRD.BACKUP"
4920 [152]15,"R0:GRD.BACKUP=G"[170]F$
4930 [159]8,8,8,"0:G"[170]F$[170]",S,W"
4940 [152]8,[199](NG);
4950 SB$(NG)[178]DD$:WT$(NG)[178]DD$
4960 [129]J[178]1[164]NG
4965 [152]8,SB$(J)
4970 [152]8,WT$(J)
4980 [129]I[178]1[164]NS
4990 [152]8,[199](A(I,J));
5000 [130]I:[130]J
5010 [160]8:[139]SD[178]0[167][142]
5020 [153]"PEEKACKUP COPY? YWAIT/N
5030 GS$="YN":GOSUB3800:SD=0 :IFV=2THENRETURN
5040 PRINT"[201]NSERT SECOND DISK AND PRESS RETURN[146]
5050 GS$[178][199](13):[141]3800:[137]4910
5100 [143] TEST NAME FOR DROP
5110 FG[178]0:[139][200](SN$(I),4)[178]"DROP" [167]FG[178]1:[142]
5120 SN$[178]SN$(I)
5130 [142]